//package com.xiguaji.tiktok.task.blogger.repository;
//
//import com.gugee.tiktok.common.model.dto.SlimBloggerDto;
//import com.gugee.tiktok.common.model.mysql.BloggerMain;
//import com.gugee.tiktok.data.common.msg.BloggerMessage;
//import org.springframework.data.jdbc.repository.query.Query;
//import org.springframework.data.repository.CrudRepository;
//import org.springframework.stereotype.Repository;
//
//import java.util.Collection;
//import java.util.List;
//import java.util.Optional;
//
//@Repository
//public interface BloggerMainRepository extends CrudRepository<BloggerMain, Long>, BloggerMainExtRepository {
//    boolean existsByoUid(long oUid);
//
//    /**
//     * 不分类且按粉丝数排序查询播主
//     * @param start
//     * @param count
//     * @return
//     */
//    @Query("SELECT id,o_uid as uid,o_region as region FROM blogger_main " +
//            " WHERE blogger_type_audit_status = 0 " +
//            " AND o_region != 'IN' " +
//            " ORDER BY o_follower_count DESC " +
//            " LIMIT :start,:count")
//    List<BloggerMessage> findBloggerMessagesForAuditStatusAndCount(long start, long count);
//
//    /**
//     * 分类且按分数排序 查询播主，
//     * @param type
//     * @param top
//     * @return
//     */
//    @Query("SELECT id,o_uid as uid,o_region as region,blogger_type,'true' as ranking FROM blogger_main " +
//            " where blogger_type = :type "+
//            " AND o_region != 'IN' " +
//            " ORDER BY score DESC " +
//            "LIMIT 0,:top")
//    List<BloggerMessage> findBloggerMessagesByBloggerTypeSortDesc(String type,long top);
//
//    @Query("SELECT id,o_uid as uid,o_region as region FROM blogger_main " +
//            "WHERE id > :id " +
//            "AND o_region != 'IN'" +
//            "ORDER BY id ASC " +
//            "LIMIT :count")
//    List<SlimBloggerDto> findSlimBloggersByIdAndCount(long id, int count);
//
//    @Query("SELECT id,o_uid as uid,o_region as region FROM blogger_main " +
//            "WHERE  o_region != 'IN' " +
//            "ORDER BY o_follower_count DESC " +
//            "LIMIT :start,:count")
//    List<SlimBloggerDto> findSlimBloggersForAuditStatusAndCount(int start, int count);
//
//
//    @Query("SELECT id,o_uid as uid,o_region as region FROM blogger_main " +
//            "WHERE o_region != 'IN' " +
//            "ORDER BY o_follower_count DESC " +
//            "LIMIT :start,:count")
//    List<SlimBloggerDto> findSlimBloggersFollowerAndCount(int start, int count);
//
//    @Query("SELECT id,o_uid as uid,o_region as region FROM blogger_main " +
//            "WHERE o_region != 'IN' " +
//            "ORDER BY score DESC " +
//            "LIMIT :start,:count")
//    List<SlimBloggerDto> findSlimBloggersScoreAndCount(int start, int count);
//    @Query("SELECT id,o_uid as uid,o_region as region FROM blogger_main " +
//            "WHERE o_follower_count  > :followers and o_region != 'IN' " +
//            "ORDER BY score DESC " +
//            "LIMIT :start,:count")
//    List<SlimBloggerDto> findSlimBloggersScoreAndOFollower(int followers,int start, int count);
//    @Query("SELECT * FROM blogger_main " +
//            "WHERE  o_region != 'IN'" +
//            "ORDER BY score DESC " +
//            "LIMIT :start,:count")
//    List<BloggerMain> findBloggersByIdAndCount(int start, int count);
//
//    @Query("SELECT * FROM blogger_main " +
//            "WHERE id > :id " +
//            "AND o_region != 'IN'" +
//            "ORDER BY id ASC " +
//            "LIMIT :count")
//    List<BloggerMain> findBloggersByIdAndCount(long id, int count);
//
//    @Query("SELECT id,o_uid as uid,o_region as region FROM blogger_main WHERE blogger_type != '';")
//    List<SlimBloggerDto> findAuditSlimBloggers();
//
//    @Query("SELECT blogger_type FROM blogger_main WHERE o_uid = :oUid")
//    String findTypeByoUid(long oUid);
//
//    Optional<BloggerMain> findByoUid(long oUid);
//
//    List<BloggerMain> findByoUniqueIdIn(Collection<String> oUniqueIds);
//
//    List<BloggerMain> findByoUidIn(List<Long>  ids);
//}
